Fix: Make coverage error messages framework-agnostic#1990
Conversation
Error messages in coverage_utils.py hardcoded "Jest" even when the test framework was Vitest. This caused confusion in logs when Vitest tests failed (e.g., "Jest coverage file not found" when using Vitest). The JestCoverageUtils class is used for both Jest and Vitest since they share the same Istanbul/v8 coverage format. Error messages should be framework-agnostic. Changes: - "Jest coverage file not found" → "JavaScript coverage file not found" - "Failed to parse Jest coverage file" → "Failed to parse JavaScript coverage file" - "No coverage data found for X in Jest coverage" → "No coverage data found for X in JavaScript coverage" - "Function X not found in Jest fnMap" → "Function X not found in JavaScript fnMap" Affected trace IDs: 37e5a406, 735555fa, 940dfe80, c1e1de0e, dbec6c33, de96b1ab, fcf08c6b (7 logs from Apr 4 00:50 batch) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Claude finished @mohammedahmed18's task in 2m 1s —— View job PR Review SummaryPrek Checks
Code ReviewProduction change ( Test file (
Duplicate DetectionNo duplicates detected. The PR modifies string literals only; no new logic is introduced. Last updated: 2026-04-04 |
Problem
Error messages in
coverage_utils.pyhardcoded "Jest" even when the test framework was Vitest, causing confusion in logs (e.g., "Jest coverage file not found" when using Vitest).Root Cause
The
JestCoverageUtilsclass is used for both Jest AND Vitest since they share the same Istanbul/v8 coverage format. Error messages should be framework-agnostic, not hardcode "Jest".Solution
Changed 4 error message strings to be framework-agnostic:
❌ "Jest coverage file not found"
✅ "JavaScript coverage file not found"
❌ "Failed to parse Jest coverage file"
✅ "Failed to parse JavaScript coverage file"
❌ "No coverage data found for X in Jest coverage"
✅ "No coverage data found for X in JavaScript coverage"
❌ "Function X not found in Jest fnMap"
✅ "Function X not found in JavaScript fnMap"
Testing
tests/verification/test_coverage_utils_framework_agnostic.pyuv run prekpasses with no linting/type errorsAffected Logs
This fix improves clarity for 7 logs from the Apr 4 00:50 optimization batch:
Note
The actual test failures in these logs (tests not passing for original code) are non-deterministic LLM test generation issues - expected behavior per workflow, not systematic bugs requiring fixes.